package DatagramSocketDemo;

import java.io.*;
import java.net.*;

public class SendDemo {
//主机名 LAPTOP-MB8RB9EL
	public static void main(String[] args) throws IOException {
		DatagramSocket ds = new DatagramSocket();

		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String line;

		InetAddress address = InetAddress.getByName("192.168.235.120");
		int port = 10086;

		while ((line = bf.readLine()) != null) {
			if (line == "再见") {
				break;
			}

			byte put[] = line.getBytes();
			DatagramPacket dp = new DatagramPacket(put, put.length, address, port);
			ds.send(dp);

		}
		ds.close();

	}

}
